package main

import (
	"fmt"
	"reflect"
)

func MyAdd(a, b int32) (int32, int32) {
	fmt.Println(111)
	return a + b, 1
}

func MyAdd2(a, b int32) int32 {
	fmt.Println(222)
	return a + b*2
}

func CallAdd(f any) {
	v := reflect.ValueOf(f)
	if v.Kind() != reflect.Func {
		return
	}
	args := make([]reflect.Value, 2)
	args[0] = reflect.ValueOf(int32(1))
	args[1] = reflect.ValueOf(int32(2))

	ret := v.Call(args)
	fmt.Println(ret[0])
}

func main() {
	CallAdd(MyAdd2)
}
